CLASSPATH='champ/*:vivace/*:vivace/view/*:.'

all: 
	zsh -c "javac -encoding ISO8859-1 -cp ${CLASSPATH} **/*java"

run: all
	java -cp ${CLASSPATH} vivace.Start

clean:
	rm vivace/*class vivace/model/*class vivace/view/*class vivace.jar

jar: all
	@echo -n "Unzipping champ.jar..."
	@if unzip champ/champ.jar 1>/dev/null; then echo "[[32mOK[0m]" ;else echo "[33mFAIL[0m]"; fi
	@echo -n "Compiling jar archive..."
	@if LANG=sv_SE jar cfe vivace.jar vivace/Start lib/ resources/ vivace; then echo "[[32mOK[0m]" ;else echo "[33mFAIL[0m]"; fi
	@echo -n "Removing temporary directories..."
	@if rm -r lib && rm -r META-INF; then echo "[[32mOK[0m]" ;else echo "[33mFAIL[0m]"; fi
